home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 2: CDPD 1 / Almathera Ten on Ten - Disc 2: CDPD 1.iso / pd / 076-100 / 084 / audiotools / globals.c < prev    next >
C/C++ Source or Header  |  1995-03-13  |  2KB  |  45 lines

  1. /* globals.c */
  2.  
  3. struct  IOAudio     openIOB;      /* IOB to open and close the device */
  4. struct  MsgPort     *auReplyPort; /* temporary pointer */
  5. struct  MsgPort     *controlPort; /* Port for ControlChannel functions */
  6.  
  7. char    *globalname     = "global";    /* the name for global IOB's  */
  8. char    *dynamicname     = "dynamic";    /* the name for dynamic IOB's */
  9.  
  10. UBYTE stereostuff[4]     = { 3, 5, 10, 12 };    /* channel masks for stereo */
  11. UBYTE anychan[4]     = { 1, 2, 4, 8 };    /* channel masks for mono */
  12.  
  13. /* Resolve all externals */
  14.  
  15. struct ExtIOB          audbuffer[AUDBUFFERS];    /* globals to build-in       */
  16. UBYTE             *chipaudio[4];    /* pointers to waveforms in CHIP RAM */
  17. struct Unit         *unit[4];    /* global pointers to Units        */
  18. struct Device         *device;    /* global pointer to audio device  */
  19. LONG             datalength[4];    /* length of the data for a wave   */
  20. struct MsgPort         *replyPort[4];  /* one ReplyPort per channel       */
  21. BYTE             inuse[AUDBUFFERS]; /* keep track of globals in-use */
  22. WORD             key[4];        /* global value for alloc keys     */
  23. struct Unit        *gotunit;    /* returned unit value             */
  24. WORD              gotkey;        /* returned allocation key         */
  25. LONG            dynamix[4];    /* counters for how many
  26.                      * dynamically allocated audio
  27.                      * message I/O blocks 
  28.                      */
  29.  
  30. /* Each waveform buffer contains 8 octaves of the wave.  
  31.  * The offset values specify where in the buffer the
  32.  * proper waveform table for that octave begins.
  33.  */
  34. int woffsets[]     = { 0, 256, 384, 448, 480, 496, 504, 508, 510 };
  35.  
  36. /* Length of each waveform within a buffer */
  37. int wlen[]     = { 256, 128, 64, 32, 16, 8, 4, 2, 1 };
  38.  
  39. /* Period value to go with particular notes within an octave. */
  40. int perval[]     = { 428, 404, 381, 360, 339, 320, 
  41.                  302, 285, 269, 254, 240, 226, 214 };
  42.  
  43. UBYTE *w1, *w2, *w3;
  44. BYTE *owptr[4]     = { NULL, NULL, NULL, NULL };
  45.